package me.zy.web;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by yuzhou on 2017/9/30.
 */
@Controller
@RequestMapping("/")
public class MainController {

  private static final Logger _log = LoggerFactory.getLogger(MainController.class);

  @GetMapping("/")
  public String index() {
    _log.info("Enter into index page");
    return "index";
  }

  @GetMapping("/index")
  @ResponseBody
  public Map index2() {
    _log.info("Enter into index action");
    Map temp = new HashMap();
    temp.put("a", 1);
    return temp;
  }
}
